/** 
 * Project Name:ZhiWeiCateringManagementSystem 
 * File Name:PayOrderRecordItemAction.java 
 * Package Name:cn.ccit.servers 
 * Date:2016年11月5日下午7:18:38 
 * Copyright (c) 2016, 120026139@qq.com All Rights Reserved. 
 * 
 */

package cn.ccit.action;

import java.util.List;

import com.opensymphony.xwork2.ModelDriven;

import cn.ccit.entites.record.PayOrderRecordItem;
import cn.ccit.iservers.IPayOrderRecordItemServers;
import cn.ccit.model.BaseModel;
import cn.ccit.servers.PayOrderRecordItemServers;

/**
 * ClassName:PayOrderRecordItemAction <br/>
 * Function: 结算记录明细表 <br/>
 * Reason: <br/>
 * Date: 2016年11月5日 下午7:18:38 <br/>
 * 
 * @author Administrator
 * @version
 * @since JDK 1.6
 * @see
 */
public class PayOrderRecordItemAction extends BaseRecordAction implements
		ModelDriven<PayOrderRecordItem> {

	/**
	 * serialVersionUID:(版本号).
	 * 
	 * @since JDK 1.6
	 */
	private static final long serialVersionUID = 1L;
	private IPayOrderRecordItemServers PayOrderItemServers = new PayOrderRecordItemServers();
	private PayOrderRecordItem PayOrderItem = new PayOrderRecordItem();

	@Override
	public String addData() {
		sendJsonData(PayOrderItemServers.addPayOrderRecordItem(PayOrderItem),
				new BaseModel<PayOrderRecordItem>());
		return super.addData();
	}

	@Override
	public String removeData() {
		sendJsonData(
				PayOrderItemServers.removePayOrderRecordItem(PayOrderItem),
				new BaseModel<PayOrderRecordItem>());
		return super.removeData();
	}

	@Override
	public String changeDataInfo() {
		sendJsonData(
				PayOrderItemServers.changePayOrderRecordItemInfo(PayOrderItem),
				new BaseModel<PayOrderRecordItem>());
		return super.changeDataInfo();
	}

	@Override
	public String getDataList() {
		sendJsonDataList(
				PayOrderItemServers.getSomePayOrderRecordItems(startId, limit),
				new BaseModel<List<PayOrderRecordItem>>());
		return super.getDataList();
	}

	@Override
	public String sreachDataById() {
		PayOrderRecordItem pi=PayOrderItemServers.searchPayOrderRecordItemByID(PayOrderItem
				.getId());
		sendJsonData(
				pi != null, new BaseModel<PayOrderRecordItem>(),
				pi);
		return super.sreachDataById();
	}

	@Override
	public PayOrderRecordItem getModel() {
		return PayOrderItem;
	}

	@Override
	public String searchDataListByYear() {
		sendJsonDataList(
				PayOrderItemServers.searchPayOrderRecordItemByYear(PayOrderItem
						.getOrderYear()),
				new BaseModel<List<PayOrderRecordItem>>());
		return super.searchDataListByYear();
	}

	@Override
	public String searchDataListByMonth() {
		sendJsonDataList(
				PayOrderItemServers.searchPayOrderRecordItemByMonth(PayOrderItem
						.getOrderMonth()),
				new BaseModel<List<PayOrderRecordItem>>());
		return super.searchDataListByMonth();
	}

	@Override
	public String searchDataListByDate() {
		sendJsonDataList(
				PayOrderItemServers.searchPayOrderRecordItemByDate(PayOrderItem
						.getOrderDate()),
				new BaseModel<List<PayOrderRecordItem>>());
		return super.searchDataListByDate();
	}

	@Override
	public String searchDataListBySerialsNumber() {
		sendJsonDataList(
				PayOrderItemServers.searchPayOrderRecordItemBySerialsNumber(PayOrderItem
						.getSerialsNumber()),
				new BaseModel<List<PayOrderRecordItem>>());
		return super.searchDataListBySerialsNumber();
	}

}
